﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMathLibrary
{
    /// <summary>
    /// This class represents an abstract base for all number factorizer classes.
    /// </summary>
    [Serializable]
    public abstract class AbstractNumberFactorizer
    {
        /// <summary>
        /// The number to factorize.
        /// </summary>
        private UInt64 number;

        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractNumberFactorizer"/> class.
        /// </summary>
        /// <param name="number">The number to factorize.</param>
        protected AbstractNumberFactorizer(UInt64 number)
        {
            this.number = number;
        }

        /// <summary>
        /// Gets or sets the number to factorize.
        /// </summary>
        /// <value>The number to factorize.</value>
        public UInt64 Number
        {
            get { return number; }
            set { number = value; }
        }

        /// <summary>
        /// Factorizes the specified number.
        /// </summary>
        /// <returns>The factors of the number.</returns>
        public abstract UInt64[] Factorize();
    }
}